home *** CD-ROM | disk | FTP | other *** search
/ CICA 1993 April / CICA MS Windows - April 1993.iso / unzipped / misc / iv26_w30 / intervie / frame.h < prev    next >
C/C++ Source or Header  |  1991-11-27  |  4KB  |  134 lines

  1. /*
  2.  * Copyright (c) 1987, 1988, 1989 Stanford University
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and its
  5.  * documentation for any purpose is hereby granted without fee, provided
  6.  * that the above copyright notice appear in all copies and that both that
  7.  * copyright notice and this permission notice appear in supporting
  8.  * documentation, and that the name of Stanford not be used in advertising or
  9.  * publicity pertaining to distribution of the software without specific,
  10.  * written prior permission.  Stanford makes no representations about
  11.  * the suitability of this software for any purpose.  It is provided "as is"
  12.  * without express or implied warranty.
  13.  *
  14.  * STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  15.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
  16.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  17.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  18.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  19.  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  20.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  21.  */
  22.  
  23. /*
  24.  * A frame surrounds another interactor.
  25.  */
  26.  
  27. #ifndef frame_h
  28. #define frame_h
  29.  
  30. #include <InterViews/scene.h>
  31.  
  32. class Frame : public MonoScene {
  33. public:
  34.     Frame(Interactor* = nil, int width = 1);
  35.     Frame(const char*, Interactor* = nil, int width = 1);
  36. protected:
  37.     int left:8, bottom:8, right:8, top:8;
  38.     
  39.     Frame(Interactor*, int, int, int, int);
  40.     Frame(const char*, Interactor*, int, int, int, int);
  41.  
  42.     virtual void Reconfig();
  43.     virtual void Resize();
  44.     virtual void Redraw(Coord, Coord, Coord, Coord);
  45. private:
  46.     void Init(Interactor*, int, int, int, int);
  47. };
  48.  
  49. class ShowFrame : public Frame {
  50. public:
  51.     ShowFrame(Interactor* i = nil, int width = 1) : Frame (i, width) { Init(); }
  52.     ShowFrame(
  53.     const char* name,
  54.     Interactor* i = nil, int width = 1
  55.     ) : Frame (name, i, width) { Init(); }
  56.  
  57.     virtual void Handle(Event&);
  58.     virtual void HandleInput(Event&);
  59.     virtual void InsideFrame(boolean);
  60. protected:
  61.     ShowFrame(
  62.     Interactor* i, int l, int b, int r, int h
  63.     ) : Frame (i, l, b, r, h) { Init(); }
  64.     ShowFrame(
  65.     const char* name,
  66.     Interactor* i, int l, int b, int r, int h
  67.     ) : Frame (name, i, l, b, r, h) { Init(); }
  68. private:
  69.     void Init();
  70. };
  71.  
  72. class Banner;
  73.  
  74. class TitleFrame : public ShowFrame {
  75. public:
  76.     TitleFrame(Banner*, Interactor*, int width = 1);
  77.     TitleFrame(const char*, Banner*, Interactor*, int width = 1);
  78.  
  79.     virtual void InsideFrame(boolean);
  80. protected:
  81.     Banner* banner;
  82.  
  83.     virtual Interactor* Wrap(Interactor*);
  84. private:
  85.     void Init(Banner*, Interactor*);
  86. };
  87.  
  88. class BorderFrame : public ShowFrame {
  89. public:
  90.     BorderFrame(Interactor* = nil, int width = 1);
  91.     BorderFrame(const char*, Interactor* = nil, int width = 1);
  92.  
  93.     virtual void InsideFrame(boolean);
  94. protected:
  95.     virtual void Redraw(Coord, Coord, Coord, Coord);
  96. private:
  97.     boolean normal;
  98.  
  99.     void Init();
  100. };
  101.  
  102. class ShadowFrame : public Frame {
  103. public:
  104.     ShadowFrame(Interactor* = nil, int h = 1, int v = 1);
  105.     ShadowFrame(const char*, Interactor* = nil, int h = 1, int v = 1);
  106. protected:
  107.     virtual void Redraw(Coord, Coord, Coord, Coord);
  108. private:
  109.     void Init(Interactor*, int h, int v);
  110. };
  111.  
  112. class MarginFrame : public Frame {
  113. public:
  114.     MarginFrame(Interactor* = nil, int margin = 0);
  115.     MarginFrame(const char*, Interactor* = nil, int margin = 0);
  116.     MarginFrame(Interactor*, int margin, int shrink, int stretch);
  117.     MarginFrame(Interactor*, int hmargin, int vmargin);
  118.     MarginFrame(Interactor*,
  119.         int hmargin, int hshrink, int hstretch,
  120.         int vmargin, int vshrink, int vstretch
  121.     );
  122. protected:
  123.     virtual void Reconfig();
  124.     virtual void Resize();
  125.     virtual void Redraw(Coord, Coord, Coord, Coord);
  126. protected:
  127.     int hmargin, hshrink, hstretch;
  128.     int vmargin, vshrink, vstretch;
  129. private:
  130.     void Init(int, int, int, int, int, int);
  131. };
  132.  
  133. #endif
  134.